import { axios , upFile } from './util.js'; //引入请求地址;
//文档地址 http://huoyun.wuliang666.com/api.php
// User
const getUserInfo = (data,topLoading = false) => axios({ url: "/user/get_user_info", data ,topLoading}); //获取用户信息
const setUserName = (data,topLoading = false) => axios({url:"/user/set_nick_name", data ,topLoading}) //设置用户姓名
const setHeading = (data,topLoading = false) => axios({url:"/user/set_head_img" , data,topLoading}); //设置头像
const submitSuggest = (data,topLoading = false) => axios({url:"/user/post_user_feedback",data,topLoading}) //意见反馈 @param content
const addOftenAddress = (data,topLoading = false) => axios({url:"/user/post_user_add_address",data,topLoading}) //添加常用地址 具体参数参照文档
const getOftenAddress = (data,topLoading = false) => axios({url:"/user/get_user_my_address" , data,topLoading}) //获取我的常用地址
const getOnlyAddress = (data,topLoading = false) => axios({url:"/user/get_user_one_address", data,topLoading}) //根据id查询具体某个地址
const deleteOftenAddress = (data,topLoading = false) => axios({url:"/user/post_user_del_address" , data,topLoading}) //删除地址 id
const applyMoney = (data,topLoading = false) => axios({url:"/user/post_user_money" , data,topLoading}) //提现 @params money 
const sendOrder = (data,topLoading = false) => axios({url:"/user/post_user_send_order" ,data,topLoading}) //发布订单 具体参数参照文档
const cancleOrder = (data,topLoading = false) => axios({url:"/user/post_user_cancel_order" , data,topLoading}) //车主取消某个订单 
const waitCancleOrder = (data,topLoading = false) => axios({url:'/user/post_user_driver_cancel',data,topLoading}) //等待取消订单
const getMyOrder = (data,topLoading = false) => axios({url:'/user/delete_user_my_order' , data,topLoading}) //获取我的订单
const getOrderDtl = (data,topLoading = false) => axios({url:"/user/post_user_get_detail", data,topLoading}) //获取订单详情 @params id ， type 1进行中 2已完成
const completeOrder = (data,topLoading = false) => axios({url:"/user/post_user_accept_order" , data,topLoading}) //接受某个订单（车主/司机邀请）--待定
const confirmOrder = (data,topLoading = false) => axios({url:"/user/post_user_accept_finish" , data,topLoading}) //完成某个订单    @params id
const acOrder = (data,topLoading = false) => axios({url:'/user/delete_user_accept', data,topLoading}) //司机大厅接收订单 @params id
const evalOrder = (data,topLoading = false) => axios({url:"/user/post_user_comment" , data,topLoading}) //评价某条订单
const inviteAcOrder = (data,topLoading = false) => axios({url:'/user/post_user_invite_driver', data,topLoading});// 邀请截单 邀请人的id user_id
const getDriverList = (data,topLoading = false) => axios({url:'/user/post_get_go_list' , data,topLoading}) //车主获取司机出发列表 type  0全部1出发地最近2目的地最近
const getUserList = (data,topLoading = false) => axios({url:'/user/post_user_accept_list' , data,topLoading}) //司机接单列表 type 0全部1才出发地近2目的地近 invite 	0大厅1邀请我的
const getMyPending = (data,topLoading = false) => axios({url:"/user/get_user_my_one" , data,topLoading}) //获取正在等待的订单
const getIdAuth = (data,topLoading = false) => axios({url:"/user/delete_user_real_auth",data,topLoading}) //用户实名认证
const upDriverAuth = (data,topLoading = false) => axios({url:"/user/delete_user_driver",data,topLoading}) //驾驶证认证
const getUserOrderStatus = (data,topLoading = false) => axios({url:"/user/post_user_get_status",data,topLoading}); //获取用户订单状态（当前是否存在进行中，或等待接单的订单）
const changeUserRole = (data,topLoading = false) => axios({url:'/user/delete_user_status' , data , topLoading}) //改变用户状态
const getUserComment = (data,topLoading = false) => axios({url:"/user/delete_user_comment" , data , topLoading}) //获取某个用户评论
const wochufa = (data,topLoading = false) => axios({url:"/user/delete_user_accept_finish",data,topLoading}) //司机我已出发
const getDriverAdv = (data,topLoading = false) => axios({url:"/home/get_driver_adv",data,topLoading}) //司机认证广告
const getadvMain = (data,topLoading = false) => axios({url:"/home/get_mess_adv",data,topLoading}); //共工建立广告 
//登录部分
const codeLogin = (data,topLoading = false) => axios({url:"/login/wx_login_reg",data,topLoading}); //登录接口 具体参数参照文档
const lgout = (data,topLoading = false) => axios({url:'/login/login_out',data,topLoading}) //登出接口
const sendCode = (data,topLoading = false) => axios({url:'/login/post_code',data,topLoading}) //短信验证码
const getOpenId = (data,topLoading = false) => axios({url:"/login/post_user_openid",data,topLoading}) //获取openid  @params code
const wxLogin = (data,topLoading = false) => axios({url:"/login/wx_login", data,topLoading}); //微信直接登录
//home接口
const getBanner = (data,topLoading = false) => axios({url:"/home/get_cate_adv",data,topLoading}) //banner接口  cid 分类ID  2-APP首页轮播广告3订单页轮播
const getAbout = (data,topLoading = false) => axios({url:"/home/get_home_about_shop",data,topLoading}) //关于我们
const getAns = (data,topLoading = false) => axios({url:'/home/get_system_notice',data,topLoading}) //获取公告 	 1协议2问题3隐私
const getUpHide = (data,topLoading = false) => axios({url:'/home/free_hide',data,topLoading})  // 隐藏数据 是否支持北京选址
const upServerFile = (filePath) => upFile({urlPath:'/home/post_home_up_img',fileName:'files',filePath});
//支付 
const getPayInfo = (data,topLoading = false) => axios({url:"/user/post_order_find",data,topLoading}) //获取支付信息 order
export {
    getadvMain,
    getUserInfo,
    setUserName,
    setHeading,
    submitSuggest,
    addOftenAddress,
    getOftenAddress,
    getOnlyAddress,
    deleteOftenAddress,
    applyMoney,
    sendOrder,
    getMyOrder,
    getOrderDtl,
    completeOrder,
    acOrder,
    evalOrder,
    inviteAcOrder,
    codeLogin,
    lgout,
    sendCode,
    getOpenId,
    wxLogin,
    getBanner,
    getAbout,
    getAns,
    upServerFile,
    getPayInfo,
    getDriverList,
    getUserList,
    getMyPending,
    getIdAuth,
    upDriverAuth,
    confirmOrder,
    cancleOrder,
    getUserOrderStatus,
    waitCancleOrder,
    getUpHide,
    changeUserRole,
    getUserComment,
    wochufa,
    getDriverAdv,
}